<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import { skuApi } from '@/feature/pdt/infra/api/skuApi'
import CURDTable from '@/framework/components/table/CURDTable'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: skuApi,
        columns: [
          {
            label: 'SPU_ID',
            prop: 'spuId',
            searchable: true,
            type: ColumnType.SELECT
          },
          {
            label: '商品库存',
            prop: 'stock',
            type: ColumnType.NUMBER
          },
          {
            label: '商品销量',
            prop: 'sales',
            type: ColumnType.NUMBER
          },
          {
            label: '价格',
            prop: 'price'
          },
          {
            label: '预览图',
            prop: 'previewImg'
          },
          {
            label: '状态',
            searchable: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '销售属性值，逗号隔开',
            prop: 'salePropValues'
          },
          {
            label: '销售属性ID列表',
            prop: 'salePropValueIds'
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          },
          {
            label: '重量，千克',
            prop: 'weight'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

